Improve runtime diagnostics and validation - #23
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: faf6a1d410
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| sf.createBackend = function (config) { | ||
| config = config || {}; | ||
| var type = config.type || 'axum'; | ||
| sf.assert(type === 'axum' || type === 'fetch' || type === 'tauri', 'createBackend(type) must be axum, fetch, or tauri'); |
There was a problem hiding this comment.
Keep non-tauri backend type labels working
This assertion is a backwards-incompatible regression for any existing HTTP integration that used a descriptive type like rails, http, or django. Before this change every non-tauri type flowed into createHttpBackend(), and that adapter is still generic (it only keys off baseUrl, schedulesPath, demoDataPath, and headers). After this commit those callers now throw during initialization even though the backend implementation would otherwise work unchanged.
Useful? React with 👍 / 👎.
| sf.gantt.create = function (config) { | ||
| sf.assert(config, 'gantt.create(config) requires a configuration object'); |
There was a problem hiding this comment.
Allow gantt.create() to fall back to its built-in defaults
Requiring config here breaks a previously valid default-construction path: every field read below already has a fallback (chartPane, gridPane, titles, view mode, split sizes, etc.), and tasks are populated later via setTasks(). Apps that currently do SF.gantt.create() or pass through an optional config now get a hard error before any of those defaults can apply.
Useful? React with 👍 / 👎.
Keep non-tauri backend labels working and preserve gantt default construction while retaining the runtime validation improvements.
Summary
SF.asserthelper for consistent error messages.